package utils;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;

/**
 * @author 19242
 */
public class EsClient {
    /**
     * 创建RestHighLevelClient
     * @return
     */
    public static RestHighLevelClient getClient(){
        HttpHost httpHost = new HttpHost("106.15.52.76", 9200);
        RestClientBuilder builder = RestClient.builder(httpHost);
        return new RestHighLevelClient(builder);
    }
}
